<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="Access-Control-Allow-Origin" content="*">
		<meta http-equiv="content-security-policy">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<!-- build:css /css/main.css -->
		<link href="/css/mui.css" rel="stylesheet" />
		<link href="/css/iconfont.css" rel="stylesheet" />
		<link href="/css/common.css" rel="stylesheet" />
		<!-- endbuild -->

	</head>

	<body>
		<div class="mui-content" id="search-content">
			<div class="u-header-bar">
				<div class="close" id="close-btn">
					<a class="mui-action-back mui-icon mui-icon-left-nav"></a>
				</div>
				<div class="mui-content-padded" style="margin:0px 40px; padding-top: 5px;">
					<div class="mui-input-row ">
						<input id="t-search" type="search" class="mui-input-clear" style=" margin-bottom: 5px; font-size:13px; width: 100%;;" placeholder="请输入宝贝名">
					</div>
				</div>
				<div id="searchBtn" class="searchBtn" onclick="getGoodsData()">搜索</div>
			</div>

			<p style="color:#666;margin:10px;">热卖搜索</p>
			<div class="mui-content-padded reicon" id="keywords">
			</div>

		</div>

		<!-- build:js /js/vendor.js -->
		<script src="/js/mui.min.js"></script>
		<!-- bower:js -->
		<script src="/bower_components/mockjs/dist/mock.js"></script>
		<script src="/bower_components/zepto/zepto.js"></script>
		<script src="/bower_components/Zepto-Cookie/zepto.cookie.js"></script>
		<!--  endbower -->
		<!-- endbuild -->
		<!-- build:js /js/main.js -->
		<script src="/js/common.js"></script>
		<script src="/js/app.js"></script>
		<!-- endbuild -->

		<script>
			mui("body").on('tap', '#searchBtn', function() {
				mui.openWindow({
					url: 'category-list.html',
					id: 'category-list.html',

				})
				localStorage.setItem('keyword', $('#t-search').val());
			});

			$('#t-search').focus();
			function getHotWords(){
						$.ajax({
							url: __BATE__ + 'api/searchKeywords',
							type: 'post',
							async: 'false',
							data: {
								code: codeVal
							},
							success: function(json) {
								if(json.ret_msg=='正常访问'){
									var html = '';
									var data = json.ret_data
									for(var i = 0; i< data.length; i++){
										html+='<span class="mui-icon ">'+data[i]+'</span>'
									}
									$('#keywords').html(html)
								}else{
									stip(json.ret_msg)
								}
								
							}
						});
					}
			getHotWords()
			mui("body").on('tap', '#keywords span', function() {
				mui.openWindow({
					url: 'category-list.html',
					id: 'category-list.html',

				})
				localStorage.setItem('keyword', $(this).text());
				localStorage.setItem('categoryid', '');
			});
		</script>
	</body>

</html>